.notice $send(%tmp.elite.mp3.check.cps) MP3 DCC Send has been cancelled due to the transfer rate falling below $elite.getsetting(Settings,MinCPS) cps.
elite.setsetting Current Sends $calc($elite.getsetting(Current,Sends) - 1) | elite.setsetting History Failed $calc($elite.getsetting(History,Failed) + 1)
.timer 1 3 amsg [MP3 DCC SEND CANCELLED] with $nick $+ . I have $!elite.getsetting(Current,Sends) of $!elite.getsetting(Settings,MaxSends) slots in use. Type 4@ $+ $me $+ -stats for my current MP3 stats.
.timer 1 4 close -s $send(%tmp.elite.mp3.check.cps)
}
if %tmp.elite.mp3.check.cps.now > $elite.getsetting(History,CPS) || $elite.getsetting(History,CPS) == n/a {
elite.setsetting History CPS %tmp.elite.mp3.check.cps.now
elite.setsetting History Nick $send(%tmp.elite.mp3.check.cps)
}
}
if %tmp.elite.mp3.check.cps < $send(0) { goto loop }
if %tmp.elite.mp3.find.file.num <= 10 { goto find.loop }
.notice $nick [MP3 @FIND] Too many results. Type: @ $+ $me $+ list to get my MP3 list.
goto find.end
}
if %tmp.elite.mp3.find.file.num == 1 { goto find.end }
if %tmp.elite.mp3.find.file.num == 2 { .msg $nick [MP3 @FIND RESULT] I have 1 match for $2 $+ . Type: @ $+ $me $+ -stats for my current MP3 Stats. }
else { .msg $nick [MP3 @FIND RESULT] I have $calc(%tmp.elite.mp3.find.file.num - 1) matches for $2- $+ . Type: @ $+ $me $+ -stats for my current MP3 Stats. }
:msg.loop
dec %tmp.elite.mp3.find.file.num
set %tmp.elite.mp3.find.file %tmp.elite.mp3.find.file. [ $+ [ %tmp.elite.mp3.find.file.num ] ]
set %tmp.elite.mp3.find.size $round($calc($lof($shortfn(%tmp.elite.mp3.find.file)) / 1048576),2) $+ mb
set %tmp.elite.mp3.find.length $elitesys.music.length($calc($lof($shortfn(%tmp.elite.mp3.find.file)) / 16000 ))
set %tmp.elite.mp3.find.bitrate $elitesys.bitrate($shortfn(%tmp.elite.mp3.find.file)) $+ kbps
set %tmp.elite.mp3.find.stereo-mono $elitesys.stereo.mono($shortfn(%tmp.elite.mp3.find.file))
set %tmp.elite.mp3.find.stereo-mono $remove(%tmp.elite.mp3.find.stereo-mono,$chr(32),$chr(40),$chr(41))
.notice $nick All slots currently in use $chr(91) $+ $elite.getsetting(Current,Sends) $+ / $+ $elite.getsetting(Settings,MaxSends) $+ $chr(93) $+ . Estimated time till next open slot is $duration($calc(($send(%tmp.elite.mp3.slot.num).size - $send(%tmp.elite.mp3.slot.num).lra) / $send(%tmp.elite.mp3.slot.num).cps)) $+ .
}
else {
.notice $nick Preparing to send you %tmp.elite.mp3.send.filename $+ . Elite MP3 Player $elitesys.version
echo 4 -a * Elite MP3 Player: Sending %tmp.elite.mp3.send.filename to $nick $+ .
if $elite.getsetting(Settings,CancelDCC) == $true { .notice $nick The transfer will be cancelled if the transfer rate falls below $elite.getsetting(Settings,MinCPS) cps. }
dcc send $nick " $+ %tmp.elite.mp3.send.file $+ "
elite.setsetting Current Sends $calc($elite.getsetting(Current,Sends) + 1)
.timer 1 3 amsg [MP3 DCC STATUS] I have $elite.getsetting(Current,Sends) of $elite.getsetting(Settings,MaxSends) slots in use. Type @ $+ $me $+ -stats for my current MP3 stats.
elite.mp3.check.cps
if $timer(EliteMP3CPS) == $null { .timerEliteMP3CPS 0 7 elite.mp3.check.cps }
}
}
unset %tmp.elite.mp3.send.*
unset %tmp.elite.mp3.slot.*
}
}
on *:TEXT:@*-stats:*: {
if $1 == @ $+ $me $+ -stats {
.msg $nick [CURRENT MP3 STATS] I have $elite.getsetting(Current,Sends) of $elite.getsetting(Settings,MaxSends) slots in use. Type @ $+ $me $+ list for my compiled list of $findfile($elite.getsetting(Paths,Base),*.mp3,*) MP3s.
:stats.loop
inc %tmp.elite.mp3.stats.num
if $right($send(%tmp.elite.mp3.stats.num).file,4) == .mp3 {
.msg $nick [MP3 DCC SWITCHES] $chr(91) $+ min. cps rate: $elite.getsetting(Settings,MinCPS) $+ $chr(93) $chr(91) $+ @find: $iif($elite.getsetting(Settings,@find) == $true, On, Off) $+ $chr(93) $chr(91) $+ max slots: $elite.getsetting(Settings,MaxSends) $+ $chr(93)
}
unset %tmp.elite.mp3.stats.*
}
on *:FILESENT:*mp3.txt: { if $nopath($filename) == $me $+ mp3.txt { elite.mp3.sendnext } }
on *:SENDFAIL:*mp3.txt: { if $nopath($filename) == $me $+ mp3.txt { elite.mp3.sendnext } }
on *:FILESENT:*.mp3: {
.timer 1 3 amsg [MP3 DCC SEND COMPLETE] with $nick $+ . I have $!elite.getsetting(Current,Sends) of $!elite.getsetting(Settings,MaxSends) slots in use. Type @ $+ $me $+ -stats for my current MP3 stats.
if $elite.getsetting(Current,Sends) > 0 { elite.setsetting Current Sends $calc($elite.getsetting(Current,Sends) - 1) }
elite.setsetting History Sent $calc($elite.getsetting(History,Sent) + 1) | if $send($nick).cps > $elite.getsettting(History,CPS) { elite.setsetting History CPS $send($nick).cps }
}
on *:SENDFAIL:*.mp3: {
.timer 1 3 amsg [MP3 DCC TIMED OUT] from $nick at $send($nick).pc $+ $chr(37) $+ . I have $!elite.getsetting(Current,Sends) of $!elite.getsetting(Settings,MaxSends) slots in use. Type @ $+ $me $+ -stats for my current MP3 stats.
if $elite.getsetting(Current,Sends) > 0 { elite.setsetting Current Sends $calc($elite.getsetting(Current,Sends) - 1) }
elite.setsetting History Failed $calc($elite.getsetting(History,Failed) + 1)
else { run $elite.getsetting(Paths,Player) $shortfn(%tmp.elite.mp3.path) }
}
:downloading
unset %tmp.elite.mp3.*
echo 4 -s * Elite MP3: $nick playing $2- in $chan $+ .
haltdef
}
ctcp ^*:VERSION: {
raw -q notice $nick : $+ $chr(1) $+ VERSION Elite MP3 $elitesys.version $+ . Copyright 1999 (c) Elite Scripters. ALL RIGHTS RESERVED
}
on *:START: {
if $version < 5.6 {
echo $colour(info) -es *** Elite MP3: This version ( $+ $strip($elite.version) $+ ) of Elite MP3 requires mIRC 5.6 or above. You version is $version $+ . Please download the latest mIRC at http://www.mirc.com/.
.timer 1 0 .unload -rs $script | halt
}
if $script(elitemp3.mrc) == $null {
linesep
echo $colour(info) -s Elite MP3: You must load elitemp3.mrc FIRST.